<?php

namespace Admin\Controller;


use Think\Controller;

class CommonController extends Controller
{
    public function __construct()
    {
        parent::__construct();
        $this->__init();
    }

    private function __init()
    {
        $isLogin = $this->isLogin();
        if (!$isLogin) {
//            $this->redirect('/Admin/Login/index');
            $this->redirect('Login/index');
        }

    }


    public function isLogin()
    {
        $user = $this->getLoginUser();
        if ($user && is_array($user)) {
            return true;
        }
        return false;
    }

    public function getLoginUser()
    {
        return session("adminUser");
    }


}